package com.itheima.controller.cpaddress;

import com.itheima.api.cpaddress.OmsCompanyAddressService;
import com.itheima.vo.domain.AjaxResult;
import com.itheima.vo.pojo.OmsCompanyAddress;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/companyAddress")
@Slf4j
public class OmsCompanyAddressController {

    @DubboReference
    private OmsCompanyAddressService addressService;

    /**
     * 获取所有收货地址
     * @return
     */
    @GetMapping("/list")
    public AjaxResult list(){
        List<OmsCompanyAddress> list = addressService.list();
        return AjaxResult.success(list);
    }

}
